import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:live_music/components/ui/cell.dart';
import 'package:live_music/components/ui/theme.dart';
import 'package:live_music/pages/login/login.dart';
import 'package:live_music/pages/publish/douyin_publish.dart';
import 'package:live_music/pages/setting/account_setting.dart';
import 'package:live_music/pages/setting/privacy_setting.dart';
import 'package:live_music/utils/sp_utils.dart';
import 'package:live_music/utils/toast_utils.dart';

class SettingsPage extends StatefulWidget {
  const SettingsPage({Key key}) : super(key: key);

  @override
  State<SettingsPage> createState() => _SettingsPageState();
}

class _SettingsPageState extends State<SettingsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        title: const Text("设置"),
      ),
      body: SafeArea(
        child: Column(
          children: [
            Cell(
              '账号安全',
              onTap: () => Get.to(AccountSetting()),
            ),
            // Cell('消息通知'),
            Cell(
              '隐私设置',
              onTap: () => Get.to(PrivacySetting()),
            ),
            Cell(
              '清除缓存',
              // right: Text(
              //   '190M',
              //   style: TextStyle(fontSize: WcaoTheme.fsL),
              // ),
            ),
            Cell('关于我们'),
            Cell('退出登录',
                onTap: () async => {
                      SPUtil.remove('userLogin'),
                      ToastUtils.showToast("退出成功"),
                      Get.offAll(LoginPage())
                    },
                border: false),
          ],
        ),
      ),
    );
  }
}
